From ba1be9573ef20d6424ae987257a1c727c47d4b53 Mon Sep 17 00:00:00 2001 From: Kyren223 Date: Tue, 6 Oct 2026 20:46:31 +0300 Subject: Initial setup for website rewrite --- src/pages/blogs/[...slug].astro | 132 ---------------------------------------- 1 file changed, 132 deletions(-) delete mode 100644 src/pages/blogs/[...slug].astro (limited to 'src/pages/blogs/[...slug].astro') diff --git a/src/pages/blogs/[...slug].astro b/src/pages/blogs/[...slug].astro deleted file mode 100644 index a7394ca..0000000 --- a/src/pages/blogs/[...slug].astro +++ /dev/null @@ -1,132 +0,0 @@ ---- -import { getCollection } from "astro:content"; -import Terminal from "@layouts/Terminal.astro"; -import BlogItem from "@components/BlogItem.astro"; -import Link from "@components/Link.astro"; -import TerminalBorder from "@components/TerminalBorder.astro"; - -export async function getStaticPaths() { - const blogEntries = await getCollection("blogs"); - return blogEntries.map((blog) => ({ - params: { slug: blog.slug }, - props: { entry: blog }, - })); -} - -const { entry } = Astro.props; -const { Content } = await entry.render(); - -const blogs = await getCollection("blogs"); -const sortedBlogs = blogs.sort((a, b) => +b.data.date - +a.data.date); -const currentIndex = sortedBlogs.findIndex((blog) => blog.slug === entry.slug); -const previousBlog = sortedBlogs[currentIndex + 1] || undefined; -const nextBlog = sortedBlogs[currentIndex - 1] || undefined; ---- - - -
-
-
- -
-
- -
-
- { - previousBlog ? ( - - - - vim ~/blogs/{previousBlog.slug}.md - - - - ) : ( - -
- - - - - -- cgit v1.3.1